package com.example.vv.model.home.base.model;

import com.example.vv.model.home.base.contract.HomeContract;
import com.example.vv.res.net.API_FACTORY;
import com.example.vv.res.net.BaseResponse;
import com.example.vv.res.net.ImageUtils;

import io.reactivex.Observable;

public class HomeModel implements HomeContract.Model {

    //m层进行网络请求
    @Override
    public Observable<BaseResponse> REQUEST_BANNER(String api) {
        return API_FACTORY.GET_API_BANNER(api);
    }

    //请求top数据
    @Override
    public Observable<BaseResponse> REQUEST_TOP(String api) {
        return API_FACTORY.GET_API_TOP(api);
    }

    //请求article数据
    @Override
    public Observable<BaseResponse> REQUEST_ARTICLE(String api) {
        return API_FACTORY.GET_API_ARTICLE(api);
    }

    @Override
    public Observable<BaseResponse> REQUEST_SEARCH(String api, String values) {
        return API_FACTORY.POST_API_SEARCH(api, values);
    }

    @Override
    public Observable<String> GET_URL() {
        return ImageUtils.getImage();
    }

    //

}
